//
//  ViewController.m
//  UI-03homeWork
//
//  Created by 402030900@qq.com on 16/7/18.
//  Copyright © 2016年 402030900@qq.com. All rights reserved.
//

#import "ViewController.h"
#import "Label.h"
#import "ImageView.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    通过UILabel封装实现只显示文字的Button
//    通过UIImageView封装实现只显示图片的Button 以上两种方式, 要考虑到通用性。
//    使用自己封装的控件, 加入到前两天编写的登陆页中
   UIControl
    Label *label = [[Label alloc]initWithFrame:CGRectMake(10, 10, 200, 50) word:@"Label封装按钮" target:self action:@selector(ClickLabelButton)];
    label.backgroundColor = [UIColor redColor];
    [self.view addSubview:label];
    ImageView *imageView = [[ImageView alloc]initWithFrame:CGRectMake(10, 300, 200, 300) image:[UIImage imageNamed:@"01.jpg"] target:self action:@selector(ClickImageViewButton)];
    imageView.backgroundColor = [UIColor greenColor];
    [self.view addSubview:imageView];
    
    
    
    
    // Do any additional setup after loading the view, typically from a nib.
}
- (void)ClickLabelButton {
    NSLog(@"轻拍Label");
}
- (void)ClickImageViewButton {
    NSLog(@"轻拍ImageView");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
